import { render,connect } from "src/hrpub/common/frame"
import TableAction from '../../actions/table.js'
import { base } from 'nc-lightapp-front'
import './index.less'

const { NCCheckbox,NCScrollElement,NCAnchor, NCScrollLink } = base


const RightDom = render({
    actions: {
        tableAct: TableAction
    }
})(({props,state,action})=>{
    
    const {editTable, main, form} = props
    const {createEditTable} = editTable
    const {createForm} = form

    return(
        <div>
           <div className="content_title">
               <div style={{display: 'none'}}>
                   {createForm('psnclrule')}
               </div>
                <span className="content_checkbox">
                    <NCCheckbox 
                        onChange={action.tableAct.onTitleBoxChange.bind(this,main.selectedIndex)}
                        checked = {main.mustEntryFlag}
                        disabled = {main.status === 'browse' || (main.sysDataSet).indexOf(main.metadata)>-1 || main.mustCheckDisable}
                    >{main.json['hrpub-000160']}</NCCheckbox>
                </span>
            </div>
            {createEditTable('psnclinfoset'+ main.selectedIndex,{
                height: main.pageHeight - 120,
                cancelCustomRightMenu: true,
                onAfterEvent: action.tableAct.onAfterTableEvent,
                onBeforeEvent: action.tableAct.onBeforeTableEvent
            })}
        </div>
    )

})
export default connect(RightDom)